import time


def computer_runtime(func):
    def wrapper(*args,**kwargs):
        # 开始时间
        start = time.time()
        print(start)
        func(*args,**kwargs)
        # 结束时间
        end = time.time()
        print(end)
        print('耗时：{:.4f}s'.format(end - start))
    return wrapper

@computer_runtime

# 被装饰函数
def run(z):
    time.sleep(1)
    t = [x**3 * z for x in range(1000)]
    print(t)
run(1000)

